﻿using Quick.EntityFrameworkCore;
using Quick.EntityFrameworkCore.Options;

namespace Microsoft.Extensions.DependencyInjection;

public static class ServiceCollectionExtensions
{
    public static AutoConfigureDbContextOptionsBuilder AutoConfigureDbContextOptions(this IServiceCollection services)
        => new AutoConfigureDbContextOptionsBuilder(services);

    public static IServiceCollection AddDatabaseProviderOptions<T>(this IServiceCollection services, Action<T> optionsAction)
    {
        services.AddTransient<IDatabaseProviderOptions<T>>(sp => new DatabaseProviderOptions<T>(optionsAction));
        return services;
    }
}
